<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<script type="text/javascript" src="../../zxt/zxt.js"></script>
		<script>
			importZXT("../../zxt");
		</script>
	</head>

	<body>

		<div id="aForm" zxt="zxt.ui.Form">
			<div zxt.name="id" zxt.title="工号" zxt.type="text"></div>
			<div zxt.name="name" zxt.title="姓名" zxt.type="text"></div>
			<div zxt.name="sex" zxt.title="性别" zxt.type="select">	</div>
			<div zxt.name="date" zxt.title="生日" zxt.type="date"></div>
		</div>
		
		<table>
			<tr>
				<td>getType()</td>
				<td>返回控件类型</td>
				<td><input type="button" name="getType" value="getType" 
					onclick="alert(表单控件的type为'+$zxtUI.aForm.getType());"/></td>
			</tr>
			<tr>
				<td>addField(conf)</td>
				<td>根据传入的配置参数增加表单域</td>
				<td><input type="button" name="addField" value="addField" 
					onclick="$zxtUI.aForm.addField({ name:'id2', title: 'addField', type: 'label'});$zxtUI.aForm.render();"/></td>
			</tr>
			<tr>
				<td>getInteractor(name)</td>
				<td>根据传入的name返回对应ZXT控件</td>
				<td><input type="button" name="getInteractor" value="getInteractor" 
					onclick="$zxtUI.aForm.getInteractor('id').renderValue('getInteractor')"/></td>
			</tr>
		</table>
		
		<div>
			<a href="../index.html">返回</a>
		</div>
	</body>
</html>

<script type="text/javascript">
	$zxt.init();		var c4sex = [{label:"男", value:"Male"}, {label:"女", value:"Female" }];
	$zxtUI.aForm.getInteractor("sex").options( c4sex );
	$zxtUI.aForm.render();
</script>
